import request from '@/utils/request.js'

// 登录
export const userLoginAPI = data => request({
	method: 'POST',
	url: '/login',
	data
})

// 注册
export const userRegisterAPI = data => request({
	method: 'POST',
	url: '/register',
	data
})

// 获取用户信息
export const getUserInfoAPI = id => request({
	url: '/user/' + id,
})

// 修改用户信息
export const editUserInfoAPI = (id, data) => request({
	method: 'POST',
	url: '/user_update/' + id,
	data
})

// 用户关注
export const followAPI = id => request({
	url: '/user_follows/' + id,
})

// 取消关注
export const unFollowAPI = id => request({
	url: '/user_unfollow/' + id,
})

// 用户点赞
export const editLikeAPI = id => request({
	url: '/post_like/' + id,
})

// 用户收藏
export const editStarAPI = id => request({
	url: '/post_star/' + id
})

// 用户关注列表
export const getUserFollowAPI = () => request({
	url: '/user_follows'
})

// 用户收藏列表
export const getUserStarAPI = () => request({
	url: '/user_star'
})

// 用户评论列表
export const getUserCommentAPI = () => request({
	url: '/user_comments'
})

// 发布评论
export const printCommentAPI = (id, data) => request({
	method: 'post',
	url: '/post_comment/' + id,
	data
})
